﻿@{
    Layout = null;
}
<link href="@Url.Content("~/Content/zTreeStyle3.4/zTreeStyle.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery.ztree.all-3.4.min.js")" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
    function loadOrganization(check, pid) {
        var _setting = {
            data: {
                simpleData: { enable: true, idKey: "ID", pIdKey: "PID" },
                key: { name: "NAME", title: "NAME" }
            },
            check: {
                enable: check,
                chkboxType: { "Y": "ps", "N": "ps" },
                chkStyle: 'checkbox'
            },
            async: { enable: true, url: '@Url.Content("~/SystemManage/Organization/GetOrganizationNodes/")' + '100' },
            callback: { onCheck: zTreeMenuCheck,
                onAsyncSuccess: zTreeOnAsyncSuccess
            }
        };
        $.fn.zTree.init($("#OrganizationCheckTree"), _setting);

    }
    function loadOrganizationNoCheckParent(check, pid) {
        var _setting = {
            data: {
                simpleData: { enable: true, idKey: "ID", pIdKey: "PID" },
                key: { name: "NAME", title: "NAME" }
            },
            check: {
                enable: true,
                chkboxType: { "Y": "", "N": "" }
            },
            async: { enable: true, url: '@ViewBag.GetOrganizeNodesUrl' },
            callback: { onCheck: zTreeMenuCheck,
                onAsyncSuccess: zTreeOnAsyncSuccess
            }
        };
        $.fn.zTree.init($("#OrganizationCheckTree"), _setting);

    }
</script>
<div class="zTreeBackground">
    <ul id="OrganizationCheckTree" class="ztree">
    </ul>
</div>
